Avoid spurious emissions of monitors-changed
authorAlexander Larsson <alexl@redhat.com>
Thu, 24 Feb 2011 18:44:16 +0000 (19:44 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 24 Feb 2011 18:47:02 +0000 (19:47 +0100)
commit0b0f110152df40795f473c805afd8548facf7377
tree65fe972d6e0cfee094a2f6d1bc9f36af7d129174
parent66e23b3a3b0544d57b6cb3d0c471a54d7cc62f0d
Avoid spurious emissions of monitors-changed

The monitor change detection code in _gdk_x11_screen_size_changed() and
process_monitors_change() goes to some length to make sure its only emitted
when there is an actual change to the data visible via the GdkScreen monitors
api.

However, commit 662e69ad added some code that always emits "monitors-changed"
in _gdk_x11_screen_size_changed when we have randr13 and get a ConfigureNotify
on the root window (even though we may already have emitted it in the
RRScreenChangesNotify event!).

As far as I can tell this is due to a comment in the bug referenced by the
commit (https://bugzilla.gnome.org/show_bug.cgi?id=601712#c4) where it says:

  This version of the patch changes GdkDisplay to emit "monitors-changed" when
  the primary monitor changes (see the change in _gdk_x11_screen_size_changed).

And, if you remove this part of the change the signal is not emitted when just
the primary is changed. However, this is not really the right approach. We
should just also check for if the primary changes in process_monitors_change()
to avoid spurious signal emissions.

https://bugzilla.gnome.org/show_bug.cgi?id=643216
gdk/x11/gdkscreen-x11.c